package metier;

public class Grade implements Comparable<Grade> {
	// ATTRIBUTS
	private Integer idGrade;
	private String libelleGrade;
	private String abrev;
	private Integer rang;

	// CONSTRUCTEURS
	public Grade(Integer idGrade, String libelleGrade, String abrev,
			Integer rang) {
		this.idGrade = idGrade;
		this.libelleGrade = libelleGrade;
		this.abrev = abrev;
		this.rang = rang;
	}

	// GETTERS et SETTERS
	public Integer getIdGrade() {
		return idGrade;
	}

	public void setIdGrade(Integer idGrade) {
		this.idGrade = idGrade;
	}

	public String getLibelleGrade() {
		return libelleGrade;
	}

	public void setLibelleGrade(String libelleGrade) {
		this.libelleGrade = libelleGrade;
	}

	public String getAbrev() {
		return abrev;
	}

	public void setAbrev(String abrev) {
		this.abrev = abrev;
	}

	public Integer getRang() {
		return rang;
	}

	public void setRang(Integer rang) {
		this.rang = rang;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return libelleGrade;
	}

	@Override
	public int compareTo(Grade o) {
		if ( this.getRang() == o.getRang() ){
			return 0;
		}else if ( this.getRang() < o.getRang() ){
			return 1;
		}else{
			return -1;
		}
	}

	// METHODES

}
